#include<stdio.h>
#include<math.h>

int is_prime(int n)
{
    int j = 0;
    for (j = 2; j <= sqrt(n); j++)
    {
        if (n % j == 0)
        {
            return 0;
        }  
    }
    
    return 1;
}
int main()
{
    int sum = 0;
    int m, n;
    int i = 0;
    int j = 0;

    scanf("%d %d",&m,&n);

    if (m >= 0 && m <= n && n <= 100)
    {
        if (m == 1)
        {
            sum = -1;
        }

        for ( i = m; i <= n; i++)
        {   
            if (is_prime(i)) //返回值为0表假，返回值为除零以外的数(1)表真
            {
                printf("%d ",i);
                sum += i;
            }
        }

        printf("\nsum = %d",sum);
    }
    
    return 0;
}